/* -----------------------------------------------------------------------------
 * PROJECT    : net.lwf
 * FILE       : PageData.java
 *
 * HISTORY:
 * Date          Author                        Description
 * ----------------------------------------------------------------------------- 
 * Feb 9, 2009  Raghu Sarraff	 		        Created
 */
package lwf.handler.entities.math;

import java.util.ArrayList;
import java.util.List;

public class PageData {
	
	private int pagenumber;
	private List rowdata;
	
	
	/**
	 * @return Returns the answers.
	 */
	//public Map getAnswers() {
		//return answers;
	//}
	/**
	 * @param answers The answers to set.
	 */
	//public void setAnswers(Map answers) {
		//this.answers = answers;
	//}
	/**
	 * @param pagenumber
	 * @param rowdata
	 */
	public PageData(int pagenumber, List rowdata) {
		this.pagenumber = pagenumber;
		this.rowdata = rowdata;
	}
	
	
	/**
	 * @return Returns the pagenumber.
	 */
	public int getPagenumber() {
		return pagenumber;
	}
	/**
	 * @return Returns the rowdata.
	 */
	public List getRowdata() {
		return rowdata;
	}
	
	public List getSums() {
		List allsums = new ArrayList();
		if(getRowdata() != null && getRowdata().size() != 0) {
			for(int i=0; i<getRowdata().size(); i++) {
				RowData rowdata = (RowData) getRowdata().get(i);
				List rowsums = rowdata.getRowsums();
				for(int j=0; j<rowsums.size(); j++) {
					MadMinSum sum = (MadMinSum) rowsums.get(j);
					allsums.add(sum);	
				}
				
			}
		}
		return allsums;
	}
}

